Defining a New Web Service Source |
|
Process Platform has some predefined Web service sources like Database Metadata, WS-AppServer Package, Data Transformation and so on. The Web Service Generation Wizard lists down the Web Service Sources available. On select, opens the User Interface for the selected Web Service Source and finally creates the web service objects inside CWS. Sometimes you may need to create Web Services on top of sources outside Cordys. In that case create new Web Service Source and plug them into the Web Service Generation wizard.
You can create new Web service source using the Web service generation wizard that performs the following functions:
- Lists the available Web service sources.
- Opens the User Interface for the selected Web service source.
- Creates the Web service objects inside CWS.
The following steps describe the procedure to create a new Web service source:
- Right-click the <CWS project> and select Web service source. The Untitled Web service source - Web service source window appears.
- Enter the name and description of the source in the Name and Description fields in the Untitled Web service source - Web service source window.
- You can create a new XForm or use an existing XForm as the Web service source. Do one of the following:
- Click and select the relevant XForm from the Select XForm dialog box.
- Click to create an XForm for the Web service source.
This form is displayed when this Web service source is selected in the Web service generation wizard.
- To plug in the XForm into the Web service generation wizard, ensure that the form has the following functions:
var definition; function Form_InitDone(eventObject) { definition = application.event.data; //Definition passed by the web service wizard } function validate() { //Validates the form and returns true or false return true; } function getWebserviceDetails() { /* //Returns an array of objects having two values wsdl XML and implementation XML var wsdls = new Array(); var wsdlObject = new Object(); //Set 'wsdl' and 'impl' properties on wsdlObject(Both should be XML Nodes) wsdls.push(wsdlObject); return wsdls; */ } function getApplicationConnectorName() { //Returns the Fully Qualified Application Connector Name }
- The Javascript object passed to the form when opened is Definition and has the following functions:
- getName(): Returns the name of the definition set object being created.
- isNewObject(): Returns true if definition set object is newly created and returns false if it is already existing in the project.
- getSelectedBindingName(): Returns the binding name selected by the user for the existing definition set.
Will return "" if the definition set object is newly created or the user did not pick an existing binding to generate the Web service. - getSelectedPortTypeName():Returns the port type name selected by the user on the first screen for existing definition set. Will return "" if the definition set object is newly created or the user did not pick an existing port type to generate the web services.
- getTargetNamespace(): Returns target Namespace of the definition set.
- addXMLSchema(schemaXMLNode, name): Creates XML schema object under the definition set using the schemaXMLNode and the name passed.
Returns the newly created XMLSchema object and should be used to create the XML schema that the WSDL needs to import. - getXMLSchemas(): Returns an array of schemas under the definition set.
- The java script object XMLSchema has the following functions:
- getName(): Returns the name of the definition set object being created.
- getObjectIdentier(): Returns the object ID of the XML schema object. WSDL can include/import this XML schema using the schema "cws-guid" followed by the object ID. A valid schema location will look like "cws-guid:91F53820-D0E8-11E0-FF32-E186EF98F3E7"
- getSchemaAsString(): Returns the XML schema as a string.
- updateSchema(schemaXMLNode): Updates the XML schema object with the content of schemaXMLNode.
- The Javascript object passed to the form when opened is Definition and has the following functions:
- Publish the Web service source and the XForm.
- Launch the Web service generation wizard. The newly created source will be available in the drop down list.
- Click Next to open the XForm for the source.
- Click Finish. The Web services will be added to the project.
- After completing the testing process, the Web service source can be packaged. By installing the Web service source ISVP/CAP, the Web service source will be available on the system.